import { fliterDataWrapper } from 'common/js/table'
export const sourceList = () => [
  { value: '物联网平台', label: '物联网平台' },
  { value: '镇街水利所', label: '镇街水利所' }
]

export const columns = (that) => {
  return [
    {
      key: 'tjName',
      align: 'center',
      width: 120,
      title: '统计项',
      render: (h, params) => {
        const { row } = params

        return fliterDataWrapper(h, row, 'tjName')
      }
    },
    {
      key: 'fss',
      align: 'center',
      title: '佛山市',
      render: (h, params) => {
        const { row } = params

        return fliterDataWrapper(h, row, '佛山市')
      }
    },
    {
      key: 'ccq',
      align: 'center',
      title: '禅城区',
      render: (h, params) => {
        const { row } = params

        return fliterDataWrapper(h, row, '禅城区')
      }
    },
    {
      key: 'nhq',
      align: 'center',
      title: '南海区',
      render: (h, params) => {
        const { row } = params

        return fliterDataWrapper(h, row, '南海区')
      }
    },
    {
      key: 'sdq',
      align: 'center',
      title: '顺德区',
      render: (h, params) => {
        const { row } = params

        return fliterDataWrapper(h, row, '顺德区')
      }
    },
    {
      key: 'gmq',
      align: 'center',
      title: '高明区',
      render: (h, params) => {
        const { row } = params

        return fliterDataWrapper(h, row, '高明区')
      }
    },
    {
      key: 'ssq',
      align: 'center',
      title: '三水区',
      render: (h, params) => {
        const { row } = params

        return fliterDataWrapper(h, row, '三水区')
      }
    },
    // {
    //   key: 'status',
    //   align: 'center',
    //   title: '状态',
    //   render: (h, params) => {
    //     const { row } = params
    //     const status = row.status
    //     let color = '#19be6b' // 默认绿色

    //     // 根据状态设置不同颜色
    //     if (status === '延迟1小时') {
    //       color = '#ff9900'
    //     } else if (status === '延迟3小时') {
    //       color = '#ff7700'
    //     } else if (status === '延迟12小时') {
    //       color = '#ff5500'
    //     } else if (status === '延迟1天') {
    //       color = '#ff3300'
    //     } else if (status === '延迟3天') {
    //       color = '#ff1100'
    //     } else if (status === '延迟7天以上' || status === '数据缺失') {
    //       color = '#ed4014'
    //     }

    //     return h('span', { style: { color } }, row.status || '--')
    //   }
    // }
  ]
}

export const townColumns = (that) => ({
  '禅城区': [{'key':'tjName','align':'center','title':'统计项'},{'key':'石湾镇街道','align':'center','title':'石湾镇街道'},{'key':'张槎街道','align':'center','title':'张槎街道'},{'key':'祖庙街道','align':'center','title':'祖庙街道'},{'key':'南庄镇','align':'center','title':'南庄镇'}],
  '南海区': [{'key':'tjName','align':'center','title':'统计项'},{"key":"里水镇","align":"center","title":"里水镇"},{"key":"大沥镇","align":"center","title":"大沥镇"},{"key":"狮山镇","align":"center","title":"狮山镇"},{"key":"丹灶镇","align":"center","title":"丹灶镇"},{"key":"西樵镇","align":"center","title":"西樵镇"},{"key":"九江镇","align":"center","title":"九江镇"},{"key":"桂城街道","align":"center","title":"桂城街道"},{"key":"东风水库","align":"center","title":"东风水库"},{"key":"未知镇","align":"center","title":"未知镇"}],
  '顺德区': [{'key':'tjName','align':'center','title':'统计项'},{"key":"均安镇","align":"center","title":"均安镇"},{"key":"杏坛镇","align":"center","title":"杏坛镇"},{"key":"龙江镇","align":"center","title":"龙江镇"},{"key":"乐从镇","align":"center","title":"乐从镇"},{"key":"北滘镇","align":"center","title":"北滘镇"},{"key":"陈村镇","align":"center","title":"陈村镇"},{"key":"容桂街道","align":"center","title":"容桂街道"},{"key":"大良街道","align":"center","title":"大良街道"},{"key":"勒流街道","align":"center","title":"勒流街道"},{"key":"伦教街道","align":"center","title":"伦教街道"}],
  '高明区': [{'key':'tjName','align':'center','title':'统计项'},{"key":"更合镇","align":"center","title":"更合镇"},{"key":"明城镇","align":"center","title":"明城镇"},{"key":"杨和镇","align":"center","title":"杨和镇"},{"key":"荷城街道","align":"center","title":"荷城街道"}],
  '三水区': [{'key':'tjName','align':'center','title':'统计项'},{"key":"南山镇","align":"center","title":"南山镇"},{"key":"芦苞镇","align":"center","title":"芦苞镇"},{"key":"白坭镇","align":"center","title":"白坭镇"},{"key":"乐平镇","align":"center","title":"乐平镇"},{"key":"大塘镇","align":"center","title":"大塘镇"},{"key":"云东海街道","align":"center","title":"云东海街道"},{"key":"西南街道","align":"center","title":"西南街道"},{"key":"未知镇","align":"center","title":"未知镇"}]
})